#include "TimerThread.hpp"
#include <stdlib.h>
#include <time.h>
#include <unistd.h>

#include <iostream>
#include <functional>

using std::cout;
using std::endl;

class Task
{
public:
    void process()
    {
        ::srand(::time(NULL));
        int num = rand() % 100;
        cout << "produce a num:" << num << endl;
    }

};

int main()
{
    cout << "TimerThread Test" << endl;
    TimerThread timer(std::bind(&Task::process, Task()), 3, 5);
    timer.start();
    sleep(20);
    timer.stop();

    return 0;
}

